package com.es.disped.dao.mapper;

import com.es.disped.dao.model.Area;
import com.es.disped.dao.model.AreaExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

/**
 * @author Anson<br>
 *	Copyright by EasyShare 2019<br>
 *  
 *  All right reserved<br>
 *
 *  Created on 2019年7月27日 下午8:44:45<br>
 *  名称：AreaMapper.java<br>
 *  描述：区域模型<br>
 */
//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface AreaMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @SelectProvider(type=AreaSqlProvider.class, method="countByExample")
    long countByExample(AreaExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @DeleteProvider(type=AreaSqlProvider.class, method="deleteByExample")
    int deleteByExample(AreaExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @Delete({
        "delete from area",
        "where area_id = #{areaId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String areaId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @Insert({
        "insert into area (area_id, area_name, ",
        "area_address, area_phone, ",
        "user_id, area_valid, ",
        "area_description)",
        "values (#{areaId,jdbcType=CHAR}, #{areaName,jdbcType=VARCHAR}, ",
        "#{areaAddress,jdbcType=VARCHAR}, #{areaPhone,jdbcType=VARCHAR}, ",
        "#{userId,jdbcType=CHAR}, #{areaValid,jdbcType=INTEGER}, ",
        "#{areaDescription,jdbcType=LONGVARCHAR})"
    })
    int insert(Area record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @InsertProvider(type=AreaSqlProvider.class, method="insertSelective")
    int insertSelective(Area record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @SelectProvider(type=AreaSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="area_id", property="areaId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="area_name", property="areaName", jdbcType=JdbcType.VARCHAR),
        @Result(column="area_address", property="areaAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="area_phone", property="areaPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.CHAR),
        @Result(column="area_valid", property="areaValid", jdbcType=JdbcType.INTEGER),
        @Result(column="area_description", property="areaDescription", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<Area> selectByExampleWithBLOBs(AreaExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @SelectProvider(type=AreaSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="area_id", property="areaId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="area_name", property="areaName", jdbcType=JdbcType.VARCHAR),
        @Result(column="area_address", property="areaAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="area_phone", property="areaPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.CHAR),
        @Result(column="area_valid", property="areaValid", jdbcType=JdbcType.INTEGER)
    })
    List<Area> selectByExample(AreaExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @Select({
        "select",
        "area_id, area_name, area_address, area_phone, user_id, area_valid, area_description",
        "from area",
        "where area_id = #{areaId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="area_id", property="areaId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="area_name", property="areaName", jdbcType=JdbcType.VARCHAR),
        @Result(column="area_address", property="areaAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="area_phone", property="areaPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.CHAR),
        @Result(column="area_valid", property="areaValid", jdbcType=JdbcType.INTEGER),
        @Result(column="area_description", property="areaDescription", jdbcType=JdbcType.LONGVARCHAR)
    })
    Area selectByPrimaryKey(String areaId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @UpdateProvider(type=AreaSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Area record, @Param("example") AreaExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @UpdateProvider(type=AreaSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") Area record, @Param("example") AreaExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @UpdateProvider(type=AreaSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Area record, @Param("example") AreaExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @UpdateProvider(type=AreaSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Area record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @Update({
        "update area",
        "set area_name = #{areaName,jdbcType=VARCHAR},",
          "area_address = #{areaAddress,jdbcType=VARCHAR},",
          "area_phone = #{areaPhone,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=CHAR},",
          "area_valid = #{areaValid,jdbcType=INTEGER},",
          "area_description = #{areaDescription,jdbcType=LONGVARCHAR}",
        "where area_id = #{areaId,jdbcType=CHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(Area record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table area
     *
     * @mbg.generated Mon Jul 01 15:44:19 CST 2019
     */
    @Update({
        "update area",
        "set area_name = #{areaName,jdbcType=VARCHAR},",
          "area_address = #{areaAddress,jdbcType=VARCHAR},",
          "area_phone = #{areaPhone,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=CHAR},",
          "area_valid = #{areaValid,jdbcType=INTEGER}",
        "where area_id = #{areaId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(Area record);
}